<div class="heading">
    <div class="left_heading"></div>
                                
    <div class="content_heading">
        <h3>Quản lý lời chúc</h3>
    </div>
                                
    <div class="right_heading"></div>
</div><!-- End .heading -->

<div class="main_content">
    <div class="table_form">
        <form class="search_form" name="search_form" action="" method="get">
        Tìm kiếm: 
        <input class="input" type="text" name="keyword" value="<?php echo $this->searchValue; ?>" />
        <input class="button" type="submit" name="search" value="Tìm kiếm" />
        <span class="msg"><?php echo $this->errorSearch; ?></span>
        </form>

        <form class="list_cat_form" action="" method="post">
        <div style="float: right;">
        	<p id="add_form">Số lượng: <span class="msg"><?php echo $this->total; ?></span> lời chúc</p>
	        <?php echo $this->formSubmit('add', 'Thêm mới', array('class' => 'button', 'id' => 'add_form')); ?>
	        <?php echo $this->formSubmit('refresh', 'Làm mới', array('class' => 'button', 'id' => 'add_form')); ?>
	        <?php echo $this->formSubmit('delete', 'Xóa', array('class' => 'button', 'id' => 'del_form', 'onclick' => 'return remove_alert()')); ?>
        </div>
        <table class="table_style">
            <tr class="head_table">
                <td width="130px">Tên đầy đủ</td>
                <td width="200px">Nội dung</td>
                <td width="50px">Trạng thái</td>
                <td class="tools">&nbsp;</td>
                <td class="tools">&nbsp;</td>
                <td class="tools"><?php echo $this->formCheckbox('check_all', null, array('id' => 'check_all', 'onClick' => 'checkAll()')); ?></td>
            </tr>
            <?php 
            	if(count($this->data) > 0) :
                    $common = new AdminDthink_Model_Common();
            		foreach($this->data as $value) : ?>
            <tr class="records">
                <td><?php echo $value['fullname']; ?></td>
                <td><?= $common->cut_string($value['content'], 80, 1); ?></td>
                <td style="padding-left: 0; text-align: center;">
                	<?php if($value['status'] == 1) : ?>
                    <a title="Hiển thị" href="<?php echo $this->baseUrl('admin-dthink/congratulations/publish?id=' . $value['id'] . '&status=' . $value['status']); ?>">
                    <img src="<?php echo $this->baseUrl('public/templates/admin/images/publish.png'); ?>" /></a>
                    <?php else : ?>
                    <a title="Ẩn đi" href="<?php echo $this->baseUrl('admin-dthink/congratulations/publish?id=' . $value['id'] . '&status=' . $value['status']); ?>">
                    <img src="<?php echo $this->baseUrl('public/templates/admin/images/unpublish.png'); ?>" /></a>
                    <?php endif; ?>
                </td>
                <td><a class="edit" title="Sửa" href="<?php echo $this->baseUrl('/admin-dthink/congratulations/edit?id=' . $value['id']); ?>"></a></td>
	            <td><a class="remove" title="Xóa" onclick="return remove_alert()" href="<?php echo $this->baseUrl('/admin-dthink/congratulations/delete?id=' . $value['id']); ?>"></a></td>
	            <td><?php echo $this->formCheckbox('check[]', $value['id']); ?></td>
            </tr>
            <?php 
                	endforeach;
                else:
            ?>
                <tr class="records">
                	<td colspan="6">Hiện không có lời chúc nào</td>
                </tr>
            <?php endif; ?>
            </table>
        </form>
    </div>
    
    <?php if(!empty($this->data) && (count($this->data > 0))) : ?>
    <div class="pagination">
        <?php
	        $currentUrl = '/?keyword=' . $this->searchValue;
	        echo $this->paginationControl($this->data, 'Sliding', 'congratulations/pagination_search.phtml', array('currentUrl' => $currentUrl));
        ?>
    </div>
    <?php endif; ?>
</div><!-- End .main_content -->  